from django.conf.urls.defaults import *
from django.views.generic import list_detail

from browsertests.specs.models import Spec

PAGINATE_BY = 100

spec_list = {
    'queryset': Spec.objects.select_related(),
    'template_object_name': 'spec',
    'paginate_by': PAGINATE_BY,
}

spec_detail = {
    'queryset': Spec.objects.select_related(),
    'template_object_name': 'spec',
}

urlpatterns = patterns('',
    url(
        regex   = '^page(?P<page>\d+)/$',
        view    = list_detail.object_list,
        kwargs  = spec_list,
        name    = 'spec-list',
    ),
    url(
        regex   = '^(?P<object_id>[\.\w]+)/$',
        view    = list_detail.object_detail,
        kwargs  = spec_detail,
        name    = 'spec-detail',
    ),
)
